package cn.gson.springboot.model.dao.privilegedao;

import cn.gson.springboot.model.pjos.Emp;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

public interface EmpDao extends CrudRepository<Emp, Integer> {

    @Query(value = "select * from emp where employees_id =?1 and Emp_is_not=1", nativeQuery = true)
    Emp empInfo(Integer employeesId);

    /**
     * 验证联系电话是否重复
     * @param phone
     * @return
     */
    @Query(value = "select * from emp where Emp_phone =?1 and  Emp_is_not=1", nativeQuery = true)
    Emp phone(String phone);

    /**
     * 验证身份证号是否重复
     * @param card
     * @return
     */
    @Query(value = "select * from emp where Emp_card =?1 and Emp_is_not=1", nativeQuery = true)
    Emp card(String card);

}
